package cn.hxzy.mapper;

import cn.hxzy.domain.Section;
import cn.hxzy.domain.Task;
import cn.hxzy.domain.vo.TaskVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface TaskMapper extends BaseMapper<Task> {

    @Select("select * from sys_task where task_id=#{taskId}")
    @Results({
            @Result(property = "section",column = "section_id",
                    javaType = Section.class,
                    one = @One(select = "cn.hxzy.mapper.SectionMapper.selectById"))
    })
    TaskVo selectTaskVo(Integer taskId);
}
